home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fatted Calf
/
The Fatted Calf.iso
/
Modules
/
BackSpaceModules
/
Source
/
MazeView
/
RandomIntPicker.m
< prev
next >
Wrap
Text File
|
1994-05-23
|
391b
|
38 lines
#import <appkit/appkit.h>
#import "RandomIntPicker.h"
@implementation RandomIntPicker
- init
{
[self reset];
return self;
}
- reset
{
count=0;
pickedInt=0;
return self;
}
- (int) choice
{
return pickedInt;
}
- (int) count
{
return count;
}
- insert: (int)newInt;
{
count++;
if (!(random()%count)) pickedInt=newInt;
return self;
}
@end